//
//  ViewController.m
//  BlockDemoProject
//
//  Created by shanezhang on 14/12/22.
//  Copyright (c) 2014年 ShaneZhang. All rights reserved.
//

#import "ViewController.h"
#import "UIAlertView+ShaneZhang.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    
    UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
    [button setFrame:CGRectMake(100, 100, 100, 40)];
    [self.view addSubview:button];
    
    [button setBackgroundColor:[UIColor redColor]];
    [button setTitle:@"show" forState:UIControlStateNormal];
    [button setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    
    [button addTarget:self action:@selector(showAlertView) forControlEvents:UIControlEventTouchUpInside];
    
}

- (void)showAlertView
{
    UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"hello" message:@"hello world" delegate:nil cancelButtonTitle:@"取消" otherButtonTitles:@"确定", nil];
    [alert showAlertViewWithCompleteBlock:^(NSInteger buttonIndex) {
        NSLog(@"您点击了第 %d 个按钮",buttonIndex);
    }];
    
}

@end
